UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Sy/IlXgnSkeycGw44eZObs4EinzDmMjw8GdCbJd5GN4='
WHERE
key_id = '0ed9977b82ffd0975b87f7e1e7667686361fbbcec4da80a9634691b43925835e'
AND (
token = 'Sy/IlXgnSkeycGw44eZObs4EinzDmMjw8GdCbJd5GN4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)