UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8eNBNGBX2/rE4XawahZFqeGb5ZKGNBwGQzH64x6P+0U=' 
WHERE 
  key_id = '4fc41ee658df650c52b8ab80cf00ee2ca0ec4e1114cd99fb2abb100ecebf549b' 
  AND (
    token = '8eNBNGBX2/rE4XawahZFqeGb5ZKGNBwGQzH64x6P+0U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031