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

Query time 0.00032