UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UIBzJ3IsBYpozb3MDhPxnqa9NILbaOrJpAwa3BKazD0='
WHERE
key_id = '1269cd78fc3c54bd7252ecfa8e147583497b00ad09f660448f150d98b0f5bc0a'
AND (
token = 'UIBzJ3IsBYpozb3MDhPxnqa9NILbaOrJpAwa3BKazD0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)