UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yjK1vEVq7nG5Vcf562HNJpL7CfZgecrEonnkYaDVlrE=' 
WHERE 
  key_id = '0c82c6a522a8b5ea35bb063995becfbf6dbb018cab821b60bc5d4fc1d59dc3d4' 
  AND (
    token = 'yjK1vEVq7nG5Vcf562HNJpL7CfZgecrEonnkYaDVlrE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021