UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'g2F5X9HBzXTfUQkMdfs1vvoYDvK7D3KU5xp1hUNq95E=' 
WHERE 
  key_id = '4cd5027d201d6af974da22074be61d7a414e6267a9a999be98e89dd5746d8d0c' 
  AND (
    token = 'g2F5X9HBzXTfUQkMdfs1vvoYDvK7D3KU5xp1hUNq95E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045