UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hY5j5SF6mjqsp4pemrTzXVj1IzxY1sDe3ymD6deo7Sk=' 
WHERE 
  key_id = '098a444c968aceaf3d840c8381f2a2097ba23af12c5011d7acfa6d7ffa8e85df' 
  AND (
    token = 'hY5j5SF6mjqsp4pemrTzXVj1IzxY1sDe3ymD6deo7Sk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041