UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FCvpcqNoPAPK2bkOQe4xEyRMj+sXTA37Y0ttZUphRRs='
WHERE
key_id = 'b7faa89f47f447321a0d034ee23b53a2cac33e48b63a7093d54428d9c5b666f1'
AND (
token = 'FCvpcqNoPAPK2bkOQe4xEyRMj+sXTA37Y0ttZUphRRs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)