UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '38iFI3bu/O2wIb210PVROxMKdxIENAANVNP9xPfNqyE='
WHERE
key_id = '2224b51f87769f38c2fc248bbd2d0e5be0ff6369a11f68886e9232775cced3cf'
AND (
token = '38iFI3bu/O2wIb210PVROxMKdxIENAANVNP9xPfNqyE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)