UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zOaqA8xpRdePC5RyFcZHsG5WZxHbyPZS5lCzjOrD6d0='
WHERE
key_id = '05761c7fdac9f857e1df109ebaf2fd0a2dbdc188dae72b84be91154ceb1a93cf'
AND (
token = 'zOaqA8xpRdePC5RyFcZHsG5WZxHbyPZS5lCzjOrD6d0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)