UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rajGYqrxfqLPYA6hvcyE05V4qfyoshfTaDOJ2j8t1n0='
WHERE
key_id = '3cfb02d36a997fb34db472512bc385d85768cf14fefdab2fe78e7e7ddb8a0e12'
AND (
token = 'rajGYqrxfqLPYA6hvcyE05V4qfyoshfTaDOJ2j8t1n0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)