UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5WYlKTQboCi2uGNSnxzdiRgAUC2cA5qBS8StnQzfk7s=' 
WHERE 
  key_id = '3cea92d453c355d41391d08816c08af5372eae82d94097ed52a1511eb17175f2' 
  AND (
    token = '5WYlKTQboCi2uGNSnxzdiRgAUC2cA5qBS8StnQzfk7s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018