UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DPiP6HT2XQ7VdaSk51smMFKRb4U3EiaCXVX8em6AkqM=' 
WHERE 
  key_id = 'a503b893ea03ad969e6f9cfe0655ccac1c1758db7176da19d3815b0569cd5b46' 
  AND (
    token = 'DPiP6HT2XQ7VdaSk51smMFKRb4U3EiaCXVX8em6AkqM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052