UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bT/KUmQw37z5hbaLiM8smjQ1ObbZUDxs0rbReYXYug0='
WHERE
key_id = '3c524ccabba157bcf4e06387814b7a38ec7ea518c1ee21854c9de4a5a76829e9'
AND (
token = 'bT/KUmQw37z5hbaLiM8smjQ1ObbZUDxs0rbReYXYug0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)