UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'aAiQAdDJ0zI6smSYj3H9b1byN7z5znueQBBIAuHqBtM=' 
WHERE 
  key_id = '30a9fe477278e85fbe9774fda769df47ed1cf78fc1fc4ca1a6f6f81ea16d3d65' 
  AND (
    token = 'aAiQAdDJ0zI6smSYj3H9b1byN7z5znueQBBIAuHqBtM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023