UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'h6yk+PpvtZYCf8Am8z+7Mt/+1KXdOYpMt/9xRJP+PiU='
WHERE
key_id = '0282aafbf2574e9863c2c87bbc5ab4b81c2ad6263478256665d4364f6e745b73'
AND (
token = 'h6yk+PpvtZYCf8Am8z+7Mt/+1KXdOYpMt/9xRJP+PiU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)