UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TSxhQ+E/L1J3u8KFzJaAicdl6Nkj1D6W/nokZTpiFMM=' 
WHERE 
  key_id = 'ee6659eb99e0e33666ab1def943e564dcb04794d9abd43be4ca65ccf99d63f9d' 
  AND (
    token = 'TSxhQ+E/L1J3u8KFzJaAicdl6Nkj1D6W/nokZTpiFMM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042