UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rgH1gZhuj9eal85QlxMTrNWVoViEWjzkm7fGn8bCVBA='
WHERE
key_id = '74e1f8c87192c6052c4f018e105acb76a2f623ef5f056d38bd7d56baa1b3c30d'
AND (
token = 'rgH1gZhuj9eal85QlxMTrNWVoViEWjzkm7fGn8bCVBA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)