UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FL/MWrYfeecKOdgPhg6Oo5t0l+YcLgyzNPuSPBx5QAI=' 
WHERE 
  key_id = '4913d66dd499909c92071180cf9b0f9f174ecf14bff7aebe09c53f1e3e3be868' 
  AND (
    token = 'FL/MWrYfeecKOdgPhg6Oo5t0l+YcLgyzNPuSPBx5QAI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046