UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wzJUV+0psGlwiFL4p/vLT7Y79ganrfp2WS87L7/JBB4='
WHERE
key_id = 'eda491e22cf99a6cc8a9e44e8f8388fcae73828ce4444b088e2993d62023a403'
AND (
token = 'wzJUV+0psGlwiFL4p/vLT7Y79ganrfp2WS87L7/JBB4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)