UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AP32HkjH6lMu03dmvhE0+JDujW5RbZrpWVYJH6LudZY='
WHERE
key_id = 'f00ef54ad5162935e33aff2981c8381f82a458922729917bc3081e168c002b38'
AND (
token = 'AP32HkjH6lMu03dmvhE0+JDujW5RbZrpWVYJH6LudZY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)