UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FA2r3JM4fhTsYW14rgc4VyzprkwhuIwSB2gSfVVfCPo='
WHERE
key_id = '523bd9a855bd8568578dd8880ab7df7f79c57326fc6706187918c3b04f973ea3'
AND (
token = 'FA2r3JM4fhTsYW14rgc4VyzprkwhuIwSB2gSfVVfCPo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)