UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '57X7vV1CRczrusLuA3q6swd9bBjaEsF8Xzf6ZkTq3Ag=' 
WHERE 
  key_id = '75e2c8d03a1f2b14f251f67d591e73979ea424b2c74e2252995069b7210bc013' 
  AND (
    token = '57X7vV1CRczrusLuA3q6swd9bBjaEsF8Xzf6ZkTq3Ag=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036