UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nEq95vlfl4XARjlknN1TF5mKaGCX9wl2VZlvN2uGlNc=' 
WHERE 
  key_id = '76e66b10b30bade77aadca339c3f7559356a81c0b46373935fd74b6a9150985e' 
  AND (
    token = 'nEq95vlfl4XARjlknN1TF5mKaGCX9wl2VZlvN2uGlNc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031