UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'c53CN5xrljO5pMHvqCIWGQzyR+4gFWb4qRInjSK0wb4='
WHERE
key_id = '2f3531b894c9b4e3047f28fc1d287a5f335d1ca5605e177e321526b5ed41f575'
AND (
token = 'c53CN5xrljO5pMHvqCIWGQzyR+4gFWb4qRInjSK0wb4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)