UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cfKCC9siAY0L1KvQwJZXAudPOB3aE3XpGZWkTaN24Js='
WHERE
key_id = '7255f8148f89905b9af13e71dae9e19f24c3d6cdb3d331ce794c5e2293d4a0f4'
AND (
token = 'cfKCC9siAY0L1KvQwJZXAudPOB3aE3XpGZWkTaN24Js='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)