UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7oANU73lci6vDa1qUMkyekwtb6IziCoUwQo+xqpSWcQ='
WHERE
key_id = 'e2b73f7431befd243668568b42d1a5ee6b9477d13fa50f05e06d302bb6bcab4b'
AND (
token = '7oANU73lci6vDa1qUMkyekwtb6IziCoUwQo+xqpSWcQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)