UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CeXGyX4FwuJzY2oL+yJ5oF9a9pP+yd/vQEDcZS15CJ4=' 
WHERE 
  key_id = '69555fc7e3cb06d662fb95a543edab11f6ad3b0d5ebb751451919af20865b0c2' 
  AND (
    token = 'CeXGyX4FwuJzY2oL+yJ5oF9a9pP+yd/vQEDcZS15CJ4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032