UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tgykSobxUDF6+dNZ8+8tiseYAveFdnpZl9n227RfyD8='
WHERE
key_id = '968e9f418b8608bf705bbb31f064f2eef529cb91243ed96e7d86e4dea8f9c748'
AND (
token = 'tgykSobxUDF6+dNZ8+8tiseYAveFdnpZl9n227RfyD8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)