UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Z2//FyQGYHnng2FvoXdFaclDDqxusVKt8bYysZZCfQE=' 
WHERE 
  key_id = 'a8dc1fcf1916433e46a065a621fdba0fdfcf43479c5ef56ec0a976af65280763' 
  AND (
    token = 'Z2//FyQGYHnng2FvoXdFaclDDqxusVKt8bYysZZCfQE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028