UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7p8FbZmFG3h82koN68JeiZRSoDa11HeldSRuUGLVd2Y=' 
WHERE 
  key_id = '85db4b49f74e44975dfdbf819f38e28e0b2a5be5bf4d58082d48fc176b57665c' 
  AND (
    token = '7p8FbZmFG3h82koN68JeiZRSoDa11HeldSRuUGLVd2Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029