UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lZIbzSstNRHYorQY9LgfMZE/2IJ/+ZmoNYZVWtTWruA='
WHERE
key_id = '98f9fa9bed3203814f3b9fbce0c6cd9bfcf100804a19417919b5a4d9c413b524'
AND (
token = 'lZIbzSstNRHYorQY9LgfMZE/2IJ/+ZmoNYZVWtTWruA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)