UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'viQaTEyE3UqVZdvIL1VbC0tqUzSlX3XHWgOqnG/dTI4='
WHERE
key_id = '6ec0f0aa350b1813031f0e3a37bad6c96fa8a0e29dbf8b27caf7bac85ee7fcda'
AND (
token = 'viQaTEyE3UqVZdvIL1VbC0tqUzSlX3XHWgOqnG/dTI4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)